<?php
declare(strict_types=1);
/**
 * MineAdmin is committed to providing solutions for quickly building web applications
 * Please view the LICENSE file that was distributed with this source code,
 * For the full copyright and license information.
 * Thank you very much for using MineAdmin.
 *
 * @Author X.Mo<root@imoi.cn>
 * @Link   https://gitee.com/xmo/MineAdmin
 */
namespace Plugin\Attractions\AttractionManagement\Request\Attraction_booking;

use Hyperf\Validation\Request\FormRequest;

/**
 * 预约订单表验证数据类
 */
class AttractionUserBookingRequest extends FormRequest
{

    public function authorize(): bool
    {
        return true;
    }


    /**
     * 新增数据验证规则
     * return array
     */
    public function rules(): array
    {
        return [
            //用户id 验证
            'user_id' => 'required',
            //预约活动信息id 验证
            'info_id' => 'required',
            //预约日期 验证
            'booking_day' => 'required',
            //预约时间段 验证
            'booking_time' => 'required',
            //预约状态1已预约2已取消3已使用 验证
            'status' => 'required',

        ];
    }


    /**
     * 字段映射名称
     * return array
     */
    public function attributes(): array
    {
        return [
            'id' => '预约订单编号',
            'user_id' => '用户id',
            'info_id' => '预约活动信息id',
            'booking_day' => '预约日期',
            'booking_time' => '预约时间段',
            'status' => '预约状态1已预约2已取消3已使用',

        ];
    }

public function messages(): array
{
    return [
            'id.required' => '必填预约订单编号',
            'user_id.required' => '必填用户id',
            'info_id.required' => '必填预约活动信息id',
            'booking_day.required' => '必填预约日期',
            'booking_time.required' => '必填预约时间段',
            'status.required' => '必填预约状态1已预约2已取消3已使用',

    ];
}
}